package com.gxa.personal.controller;

import com.gxa.common.base.RespResult;
import com.gxa.personal.entity.MyReminder;
import com.gxa.personal.service.MyReminderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * Create with IntelliJ IDEA.
 * Description:
 * User: ZY
 * Date: 2023-04-10
 * Time: 16:33
 */
@RestController
@RequestMapping("/reminder")
public class ReminderController {

    @Autowired
    MyReminderService myReminderService;


    /**
     * 查找所有提醒
     * @return
     */
    @GetMapping("/findAll")
    public RespResult findAll() {

        return myReminderService.findAllReminder();
    }

    /**
     * 添加提醒
     * @param myReminder
     * @return
     */
    @PostMapping("/add")
    public RespResult add(@RequestBody MyReminder myReminder) {

        return myReminderService.add(myReminder);
    }



    /**
     * 取消提醒
     * @param myReminderId
     * @return
     */
    @PostMapping("/cancel")
    public RespResult cancel(Integer myReminderId) {

        return myReminderService.findAllReminder();
    }

}
